﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DependencyInjection;
using PolarExpress.View.Interfaces;
using PolarExpress.Model.Interfaces;
using PolarExpress.Controller.Interfaces;

namespace PolarExpress.Controller
{
    public class EventController : IEventController
    {
        public event ModelChangedHandler ModelChanged;

        IProject _project;

        IEventView _view;

        [Inject]
        public EventController(IProject project, IEventView view)
        {
            _project = project;
            _view = view;

            
        }

        public Model.Interfaces.IModel Model
        {
            get
            {
                return _project;
            }
            set
            {
                if (value is IProject)
                {
                    _project = value as IProject;
                }
            }
        }

        public View.Interfaces.IView View
        {
            get
            {
                return _view;
            }
            set
            {
                if (value is IEventView)
                {
                    _view = value as IEventView;
                }
            }
        }
    }
}
